package www.sofn.com.utils;

import cn.hutool.core.util.StrUtil;
import www.sofn.com.constant.Constants;

public class GoodsUtils {

    private GoodsUtils() {

    }

    public static String  getGoodsDefaultImg(String carousel){
        final String[] carousels = carousel.split(",");
        if(carousels.length<1){return ""; }
        if(!StrUtil.endWith(carousels[0], Constants.Suffix_MP4))  {
             return carousels[0] ;
        }
        if(carousels.length<2){  return ""; }
        if( StrUtil.endWith(carousels[0], Constants.Suffix_MP4)){
            return carousels[1];
        }
        return "";
    }
}
